function main() {
  function reload() {
    const w = document.documentElement.clientWidth
    $('html').css({
      'font-size': `${w / 100}px`
    })
  }

  let footerHmtl = ''
  let footerInfo = [{ name: '煤改电', img: '11.png', value: '12345' }, { name: '煤改气', img: '22.png', value: '4985' }, { name: '洁净煤', img: '33.png', value: '4573' }, { name: '煤改热', img: '44.png', value: '2593' }, { name: '集中供暖', img: '55.png', value: '4685' }, { name: '太阳能', img: '66.png', value: '3658' }, { name: '其他', img: '77.png', value: '4460' }]
    var x=5;
  for (var i = 0; i < footerInfo.length; i++) {
    footerHmtl += ` <div class="type">
    <div class="typeBox">
        <div class="imgBox"><img src="./img/indexS/${footerInfo[i].img}"></div>                        
        <span class="typeNmae">${footerInfo[i].name}</span>
    </div>
    <div class="typeNum" id="num`+x+`"></div>
</div>`
      x++;
  }
$('.typefiled').html(footerHmtl)

    $('.rol').click(function () {
        if (!$('.floatBox').hasClass('right')) {
            $('.floatBox')
                .addClass('right')
                .find('.rol').text('>')
        } else {
            $('.floatBox')
                .removeClass('right')
                .find('.rol').text('<')
        }
    })

  reload()

  $(window).resize(() => {
    reload()
  })

}

$(document).ready(main);


window.requestAnimFrame = (function (callback) {
  return window.requestAnimationFrame ||
    window.webkitRequestAnimationFrame ||
    window.mozRequestAnimationFrame ||
    window.oRequestAnimationFrame ||
    window.msRequestAnimationFrame ||
    function (callback) { window.setTimeout(callback, 1000 / 60); }
})();